/*
 * EvaluationReport.cpp
 *
 *  Created on: May 2, 2012
 *      Author: lorenzo
 */

#include "EvaluationReport.h"

EvaluationReport::EvaluationReport(Formula& f) {

	this->clausesNumber = f.countClauses();
	this->satisfiedClauses = f.countSatisfiedClauses();

	iteration = 0;
	iterationsCount = 0;

	/*
	for(unsigned int i=0; i<f.varsCount() ; i++)
	{
		varsSetting.push_back(f.getVarValue(i));
	}*/
}

EvaluationReport::EvaluationReport(Formula & f, int iterations)
{
	this->clausesNumber = f.countClauses();
	this->satisfiedClauses = f.countSatisfiedClauses();

	this->iteration = iterations;
	iterationsCount = iteration;

	/*
	for(unsigned int i=0; i<f.varsCount() ; i++)
	{
		varsSetting.push_back(f.getVarValue(i));
	}*/


}

EvaluationReport::~EvaluationReport() {
	// TODO Auto-generated destructor stub
}



int EvaluationReport::getClausesNumber(){
	return clausesNumber;
}

int EvaluationReport::getsatisfiedClauses(){
	return satisfiedClauses;
}

int EvaluationReport::getIteration()
{
	return iteration;
}

EvaluationReport& EvaluationReport::operator=(EvaluationReport &er) {
  // Check for self-assignment
  if (this == &er)
    {
	  return *this;
    }

  this->clausesNumber = er.getClausesNumber();
  this->satisfiedClauses = er.getsatisfiedClauses();

  this->iteration = er.getIteration();
  this->iterationsCount = er.iterationsCount;

  // varsSetting

  return *this;
}



bool EvaluationReport::isSat()
{
	if (clausesNumber==satisfiedClauses)
	{
		return true;
	}

	return false;
}

